package com.ws.boot.demo.validate.service.i18n.impl;

import com.ws.boot.demo.validate.service.i18n.I18nService;
import com.ws.boot.web.domain.DefaultResponse;
import org.springframework.stereotype.Service;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Null;
import java.util.List;

/**
 * i18n 业务类 实现类 .
 *
 * @className: I18nServiceImpl
 * @author: ws
 * @date: 2020/4/9 11:35
 * @version: 1.0.0
 */
@Service
public class I18nServiceImpl implements I18nService {

    /**
     * 默认消息 .
     *
     * @param username
     * @param password
     * @return DefaultResponse
     * @author ws
     * @date 2020/4/9 11:22
     **/
    @Override
    public DefaultResponse defaultMessage(@NotBlank String username, @Null(message = "密码必须为空啊") String password) {
        return DefaultResponse.success();
    }

    /**
     * 默认消息加自定义参数 .
     *
     * @param username2
     * @param password2
     * @return DefaultResponse
     * @author ws
     * @date 2020/4/9 11:29
     **/
    @Override
    public DefaultResponse defaultMessageWithCustomParameter(@NotBlank String username2, @Null String password2) {
        return DefaultResponse.success();
    }

    /**
     * 默认消息加parameterKey自定义参数 .
     *
     * @param username2
     * @param password2
     * @return DefaultResponse
     * @author ws
     * @date 2020/4/9 11:29
     **/
    @Override
    public DefaultResponse defaultMessageWithParameterKey(@NotBlank String username2, @Null String password2) {
        return DefaultResponse.success();
    }

    /**
     * 自定义消息加自定义参数 .
     *
     * @param age
     * @param hobbies
     * @return DefaultResponse
     * @author ws
     * @date 2020/4/9 11:34
     **/
    @Override
    public DefaultResponse customMessageWithCustomParameter(Integer age, List<String> hobbies) {
        return DefaultResponse.success();
    }

    /**
     * 组合注解加parameterKey自定义参数 .
     *
     * @param mobile
     * @param maxnervaEmail
     * @param maxnervaEmail2
     * @return DefaultResponse
     * @author ws
     * @date 2020/4/16 16:00
     **/
    @Override
    public DefaultResponse composingConstraintWithParameterKey(String mobile
            , String maxnervaEmail
            , String maxnervaEmail2) {
        return DefaultResponse.success();
    }

}
